package com.dartsstats;

public enum Result {
	
	SINGLE(1, "Single"),
	DOUBLE(2, "Double"),
	TRIPLE(3, "Triple"),
	HOME_RUN(4, "Home run"),
	OUT(5, "Out"),
	DOUBLE_PLAY(6, "Double play"),
	TRIPLE_PLAY(7, "Triple play"),
	SAC_BUNT(8, "Sacrifice bunt"),
	SAC_FLY(9, "Sacrifice fly"),
	LITTLE_OUT(10, "Little out"),
	HIT_BY_PITCHER(11, "Hit by Pitcher"),
	BUNT(12, "Bunt"),
	HIT_BY_BATTED_BALL(13, "Hit by batted ball"),
	STOLEN_BASE(14, "Stolen base"),
	DOUBLE_STEAL(15, "Double steal"),
	STOLE_HOME(16, "Stole home"),
	BALK(17, "Balk");

	
	private final int id;
	private final String displayString;
	
	private Result(int id, String displayString){
		this.id = id;
		this.displayString = displayString;
	}
	
	public int getID(){
		return id;
	}
	
	public Result getByID(int id){
		for(Result result : values()){
			if(id==result.getID()){
				return result;
			}
		}
		return OUT;
	}
	
	public String toString() {
		return displayString;
	}
}
